/**
 * Project Name:kany-utils
 * File Name:TransparentCheckBox.java
 * Package Name:me.kany.utils.swt.checkbox
 * Date:2016年5月3日下午12:42:32
 * Copyright (c) 2016, Jason.Wang All Rights Reserved.
 *
*/

package me.kany.utils.swt.checkbox;

import java.awt.Cursor;
import java.awt.Font;

import javax.swing.ImageIcon;
import javax.swing.JCheckBox;

/**
 * ClassName:TransparentCheckBox <br/>
 * Function: 创建自定义的图标的信息. <br/>
 * Date:     2016年5月3日 下午12:42:32 <br/>
 * @author   Jason.Wang
 * @version  
 * @since    JDK 1.7
 * @see 	 
 */
@SuppressWarnings("serial")
public class TransparentCheckBox extends JCheckBox {
	/**
	 * 
	 * Creates a new instance of TransparentCheckBox.
	 *
	 */
	public TransparentCheckBox() {
		setCursor(new Cursor(Cursor.HAND_CURSOR));
		setBorder(null);
		setMargin(null);
		setOpaque(false);
		setRolloverEnabled(true);
		setContentAreaFilled(false);
		setFocusPainted(false);
		setRequestFocusEnabled(false);
	}

	/**
	 * 
	 * Creates a new instance of TransparentCheckBox.
	 *
	 * @param icon
	 * @param selectIcon			选中的样子
	 * @param roverIcon
	 * @param selectRoverIcon
	 * @param pressedIcon
	 */
	public TransparentCheckBox(ImageIcon icon, ImageIcon selectIcon, ImageIcon roverIcon, ImageIcon selectRoverIcon, ImageIcon pressedIcon) {
		setCursor(new Cursor(Cursor.HAND_CURSOR));
		setBorder(null);
		setMargin(null);
		setOpaque(false);
		setFont(new Font("宋体", 0, 12));
		setIcon(icon);
		setSelectedIcon(selectIcon);
		setRolloverEnabled(true);
		setRolloverIcon(roverIcon);
		setRolloverSelectedIcon(selectRoverIcon);
		setPressedIcon(pressedIcon);
		setContentAreaFilled(false);
		setFocusPainted(false);
		setRequestFocusEnabled(false);
	}
}
